package com.clip.util.mail;

import javax.mail.Authenticator;
import javax.mail.PasswordAuthentication;

public class MyAuthenticator extends Authenticator {

	//登录发送邮件服务器的用户名和密码 
	private String userName;
	private String password;
	
	public MyAuthenticator(String userName,String password){
		this.userName = userName;
		this.password = password;
	}
	/**
	 * 覆盖父类的方法，获得密码认证器
	 * */
	protected PasswordAuthentication getPasswordAuthentication(){
		return new PasswordAuthentication(userName,password);
	}
	
	
	public String getUserName() {
		return userName;
	}
	public void setUserName(String userName) {
		this.userName = userName;
	}
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
}
